﻿function SearchByCustomer(obj) {
    //alert("customer");
    $("#divSearchCustomerInfo").show();
    $("#divSearchBillInfo").hide();
    $("#divSearchAMCInfo").hide();
    $(".tabItemSelected").removeClass("tabItemSelected").addClass("dashboardSearchTabsGray");
    $(obj).attr("class", "tabItemSelected");
}
function searchBySale(obj) {
    //alert("sale");
    $("#divSearchBillInfo").show();
    $("#divSearchAMCInfo").hide();
    $("#divSearchCustomerInfo").hide();
    $(".tabItemSelected").removeClass("tabItemSelected").addClass("dashboardSearchTabsGray");
    $(obj).attr('class', 'tabItemSelected');
}
function searchByAMC(obj) {
    //alert("amc");
    $("#divSearchAMCInfo").show();
    $("#divSearchBillInfo").hide();
    $("#divSearchCustomerInfo").hide();
    $(".tabItemSelected").removeClass("tabItemSelected").addClass("dashboardSearchTabsGray");
    $(obj).attr("class", "tabItemSelected");
}
$(function () {
    $('#rbtnDate').click(function () {
        $('#reportByDate').show();
        $('#reportByCustomerID').hide();
        $('#reportByAMCInvoice').hide();
        $(':input', '.dashboardReportTextboxDiv')
        .not(':button, :submit, :reset, :hidden')
        .val('')
    });
    $('#rbtnCustomerID').click(function () {
        $('#reportByCustomerID').show();
        $('#reportByDate').hide();
        $('#reportByAMCInvoice').hide();
        $(':input', '.dashboardReportTextboxDiv')
        .not(':button, :submit, :reset, :hidden')
        .val('')
    });
    $('#rbtnAMCInvoice').click(function () {
        $('#reportByAMCInvoice').show();
        $('#reportByDate').hide();
        $('#reportByCustomerID').hide();
        $(':input', '.dashboardReportTextboxDiv')
        .not(':button, :submit, :reset, :hidden')
        .val('')
    });
    //$('#txtFromDate').datepicker();
    //$('#txtToDate').datepicker();


    var dates = $("#from, #to").datepicker({
        defaultDate: "+1w",
        changeMonth: true,
        numberOfMonths: 1,
        onSelect: function (selectedDate) {
            var option = this.id == "from" ? "minDate" : "maxDate",
					instance = $(this).data("datepicker"),
					date = $.datepicker.parseDate(
						instance.settings.dateFormat ||
						$.datepicker._defaults.dateFormat,
						selectedDate, instance.settings);
            dates.not(this).datepicker("option", option, date);
        }
    });

});
